home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
presto
/
presto10.lha
/
src
/
timer.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-11
|
692b
|
36 lines
#ifndef __presto__timer_h__
#define __presto__timer_h__
/*
* Generic clock interface
*/
#ifndef ITIMER_REAL
#include <sys/time.h>
#endif
extern int gettimeofday(struct timeval*, struct timezone*);
class Timer : public Object {
double t_starttime;
struct timeval t_time;
public:
Timer() {} // satisfy compiler
void init(); // intentional ctor only
~Timer();
struct timeval *getdaytime();
double getabsolutetime();
char *getasciitime();
void timerstart()
{ t_starttime = getabsolutetime(); }
void reinit()
{ timerstart(); }
double timermark()
{ return getabsolutetime() - t_starttime; }
virtual void print(ostream& = cout);
};
#endif /* __presto__timer_h__ */